March 22, 2020

R Markdown

Data Cleaning

The primary data cleaning required was transforming the data to the "longer form" consistent with tidy data practices.

tidyConfirmedCases <- confirmedCases %>%
        pivot_longer(-c(Province.State, Country.Region, Lat, Long), 
                names_to = "Date", values_to = "cumulativeCases") %>%
        mutate(Date = substring(Date, 2))%>%
        mutate(Date = mdy(Date,tz="UTC"))%>%
        select(Date,Country.Region, everything())%>%
        arrange(Date,Country.Region,Province.State)%>%
        rename(lat = Lat, lng = Long )
head(tidyConfirmedCases)
## # A tibble: 6 x 6
##   Date                Country.Region Province.State   lat    lng
##   <dttm>              <fct>          <fct>          <dbl>  <dbl>
## 1 2020-01-22 00:00:00 Afghanistan    ""              33    65   
## 2 2020-01-22 00:00:00 Albania        ""              41.2  20.2 
## 3 2020-01-22 00:00:00 Algeria        ""              28.0   1.66
## 4 2020-01-22 00:00:00 Andorra        ""              42.5   1.52
## 5 2020-01-22 00:00:00 Angola         ""             -11.2  17.9 
## 6 2020-01-22 00:00:00 Antigua and B~ ""              17.1 -61.8 
## # ... with 1 more variable: cumulativeCases <int>

Current Cases

The current cases are captured by the interactive map below:

Growth Chart

Finally, we have an interactive plot showing country specific growth.